package com.edu.controller;

import com.edu.utils.R;
import org.springframework.web.bind.annotation.*;

/**
 * @author mxs
 */
@RestController
@RequestMapping("/edu/user")
//解决跨域问题
@CrossOrigin
public class EduLoginController {
    /**
     * 登录
     *
     * @return
     */
    @PostMapping("login")
    public R login() {
        return R.success().data("token", "admin");
    }

    /**
     * 返回用户信息
     * @return
     */
    @GetMapping("info")
    public R info() {
        //定义头像位置
        String avator = "https://inews.gtimg.com/newsapp_bt/0/12870014817/1000";
        return R.success().data("roles", "[admin]")
                .data("name", "admin").data("avatar", avator);
    }
}






















